Fix chunk download failures mis-bucketed as CONNECTION_ERROR in telemetry#1469
Merged
samikshya-db merged 2 commits intoMay 27, 2026
Merged
Conversation
… telemetry The 5-arg DatabricksSQLException constructor used by ChunkDownloadTask passes CHUNK_DOWNLOAD_ERROR.name() as sqlState, but the constructor was hardcoding CONNECTION_ERROR.name() in the telemetry export. As a result, chunk download failures were recorded under the CONNECTION_ERROR bucket instead of CHUNK_DOWNLOAD_ERROR, masking the true failure category and making telemetry-driven retry/alerting analysis unreliable. Pass the caller's sqlState through to exportFailureLog so the telemetry errorName matches the SQLException's sqlState and the caller's intent. Co-authored-by: Isaac Signed-off-by: samikshya-chand_data <samikshya.chand@databricks.com>
gopalldb
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The 5-arg
DatabricksSQLException(reason, cause, statementId, chunkIndex, sqlState)constructor — used exclusively byChunkDownloadTask— hardcodedCONNECTION_ERROR.name()in itsexportFailureLogcall, ignoring thesqlStateargument passed in by the caller.ChunkDownloadTask.java:98passesCHUNK_DOWNLOAD_ERROR.name()assqlState, so chunk download failures were:SQLExceptionwith sqlStateCHUNK_DOWNLOAD_ERROR(visible to JDBC consumers), butCONNECTION_ERRORbucket.This divergence was flagged by a pre-existing
// TODO : Check chunk retry telemetry logiccomment.The fix passes the caller's
sqlStatethrough toexportFailureLog, so the telemetryerrorNamematches the SQLException's sqlState and the caller's intent.Test plan
mvn test -pl . -Dtest=ChunkDownloadTaskTestmvn test -pl . -Dtest=DatabricksSQLExceptionTestCHUNK_DOWNLOAD_ERRORgoing forward (wasCONNECTION_ERROR).NO_CHANGELOG=true
This pull request and its description were written by Isaac.